/**
 * 
 */
package IC.lir.instructions;

import IC.lir.operands.MemOperand;
import IC.lir.operands.Operand;
import IC.lir.operands.RegOperand;
import IC.lir.Instruction;
import IC.lir.Visitor;

/**
 * Move source, dest
 *
 */
public class MoveInstr extends Instruction {
	private Operand source;
	private Operand dest;
	
	/**
	 * @param source
	 * @param dest
	 */
	public MoveInstr(Operand source, Operand dest) {
		assert(! ( (source instanceof MemOperand) && (dest instanceof MemOperand))
				&& ((dest instanceof RegOperand) || (dest instanceof MemOperand)));
		this.source = source;
		this.dest = dest;
	}

	/**
	 * @return the dest
	 */
	public Operand getDest() {
		return dest;
	}

	/**
	 * @return the source
	 */
	public Operand getSource() {
		return source;
	}



	@Override
	public <D, U> U accept(Visitor<D, U> v, D context) {
		return v.visit(this, context);
	}
}
